import 'package:flutter_nb_net/flutter_net.dart';

class MonitorDataResp extends BaseNetModel {
  int? code;
  String? msg;
  MonitorData? data;

  MonitorDataResp({this.code, this.msg, this.data});

  @override
  fromJson(Map<String, dynamic> json) {
    return MonitorDataResp(
      code: json['code'],
      msg: json['msg'],
      data: json['data'] == null ? null : MonitorData().fromJson(json['data']),
    );
  }
}

class MonitorData extends BaseNetModel{
  String? deviceName;
  String? address;
  int? deviceStatus;
  String? lastCommunicationTime;
  String? gpsTime;
  int? batteryPercentage;
  double? mainsVoltage;
  double? latitude;
  double? longitude;
  double? altitude;
  double? speed;
  double? direction;
  int? locationType;
  int? csq;
  String? workMode;
  String? workModeName;
  String? iccid;
  int? chargingStatus;
  String? chargingStatusName;
  String? locationPriority;
  // 运动状态
  String? motionStateText;

  MonitorData({this.deviceName, this.address, this.deviceStatus, this.lastCommunicationTime, this.gpsTime, this.batteryPercentage, this.mainsVoltage,
    this.latitude, this.longitude, this.altitude, this.speed, this.direction, this.locationType, this.csq, this.workMode, this.workModeName, this.iccid, this.chargingStatus, this.locationPriority, this.chargingStatusName, this.motionStateText});

  @override
  fromJson(Map<String, dynamic> json) {
    return MonitorData(
      deviceName: json['deviceName'],
      address: json['address'],
      deviceStatus: json['deviceStatus'],
      lastCommunicationTime: json['lastCommunicationTime'],
      gpsTime: json['gpsTime'],
      batteryPercentage: json['batteryPercentage'],
      mainsVoltage: json['mainsVoltage'],
      latitude: json['latitude'],
      longitude: json['longitude'],
      altitude: json['altitude'],
      speed: json['speed'],
      direction: json['direction'],
      locationType: json['locationType'],
      csq: json['csq'],
      workMode: json['workMode'],
      workModeName: json['workModeName'],
      iccid: json['iccid'],
      chargingStatus: json['chargingStatus'],
      locationPriority: json['locationPriority'],
      chargingStatusName: json['chargingStatusName'],
      motionStateText: json['motionStateText'],
    );
  }
}